package cn.lx.redis.utils;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;

import javax.annotation.Resource;

/**
 * Created by lxliuxuan on 2016/11/22.
 */
public class ExampleRedis  extends  AbstractRedisUtil{
    @Resource
    private JedisPool jedisPool;
    protected Jedis getJedis() throws NullPointerException {
        return jedisPool.getResource();
    }

    protected void returnResource(Jedis jedis) {
        if (jedis != null)
        {
            try
            {
                jedisPool.returnResource(jedis);

            }
            catch (Exception e)
            {
               e.printStackTrace();
            }
        }
    }
}
